<?php

/*
 * CopyRight  : (C)2012-2099 HaoTeam Inc.
 * Document   : WechatAppAddonsValidate.php
 * Created on : 2021-2-25 12:16:52
 * Author     : Tiger <1192851302@qq.com>
 * Description: This is NOT a freeware, use is subject to license terms.
 *              这即使是一个免费软件,使用时也请遵守许可证条款,得到当时人书面许可.
 *              未经书面许可,不得翻版,翻版必究;版权归属 HaoTeam Inc;
 */

namespace app\wechat\validate;

use think\Validate;

/**
 * 应用验证器
 * Class WechatAppAddonsValidate
 * Tiger <1192851302@qq.com> 2021-2-25 12:16:52
 */
class WechatAppAddonsValidate extends Validate {

    protected $rule = [
        'id' => 'require|number',
        'name' => 'require',
        'addon' => 'require',
        'version' => 'require',
        'logo' => 'require',
        'author' => 'require',
    ];
    protected $message = [
        'id.require' => 'ID不能为空',
        'id.number' => 'ID格式不对',
        'name.require' => '应用名称不能为空',
        'addon.require' => '应用标识不能为空',
        'version.require' => '版本不能为空',
        'logo.require' => 'Logo不能为空',
        'author.require' => '作者信息不能为空',
    ];
    protected $scene = [
        'install' => ['name', 'addon', 'version', 'logo', 'author'],
        'update' => ['id', 'name', 'addon', 'version', 'logo', 'author'],
        'status' => ['id']
    ];

}
